package com.edgar.designpattern.simplefactory;

import com.edgar.designpattern.simplefactory.product.CheesePizza;
import com.edgar.designpattern.simplefactory.product.ClamPizza;
import com.edgar.designpattern.simplefactory.product.PepperoniPizza;
import com.edgar.designpattern.simplefactory.product.Pizza;
import com.edgar.designpattern.simplefactory.product.VeggiePizza;


public class SimplePizzaFactory {

	public Pizza createPizza(String type) {
		if ("cheese".equals(type)) {
			return new CheesePizza();
		} else if ("clam".equals(type)) {
			return new ClamPizza();
		} else if ("pepperoni".equals(type)) {
			return new PepperoniPizza();
		} else if ("veggie".equals(type)) {
			return new VeggiePizza();
		}
		return null;
	}
}
